package com.huilian.iotbox.data.enums;

import lombok.Getter;


@Getter
public enum MoneyBalanceRecordSecondaryTypeEnum {
    BALANCE_RECHARGE(1, "余额充值"),
    ORDER_SETTLEMENT(2, "订单结账"),
    ORDER_REFUND(3, "订单退款"),
    SEND_WELFARE(4, "派发福利"),
    MERCHANT_ADJUSTMENT(5, "商家调整人民币余额"),
    ;

    private Integer code;
    private String desc;

    MoneyBalanceRecordSecondaryTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String formatDesc(Integer code){
        MoneyBalanceRecordSecondaryTypeEnum[] values = MoneyBalanceRecordSecondaryTypeEnum.values();
        String desc = null;
        for (int i = 0; i < values.length; i++) {
            if (values[i].code.compareTo(code) == 0){
                desc = values[i].desc;
                break;
            }
        }
        return desc;
    }
}
